import http from './request'

/**
 * @description 生成问题
 * @param {*} materialId 
 * @returns 
 */
export function generateQuestion(materialId) {
    return http.post("/qa/generate", null, {
        params: {
            materialId: materialId
        },
        timeout: 600000  // 增加超时时间到30秒
    })
}

export function getQuestionList() {
    return http.get("/qa/material/get")
}

/**
 * @description 批量提交答案
 * @param {Object} answers - 答案集合，格式为 {questionId: selectedOption}
 * @param {number} materialId - 材料ID
 * @returns 
 */
export function submitAnswers(answers, materialId) {
    return http.post("/qa/submit-batch", {
        answers: answers,
        materialId: materialId
    })
}